// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  app: {
    head: {
      bodyAttrs: {
        class: 'home blog hfeed wide-screen dark-open navbar-transition pagination-numeric paged-next no-off-canvas sidebar-none modular-title-1',
      }
    }
  },

  css: [
    '@/assets/styles/base.scss',
    '@/assets/styles/index.scss',
  ],

  runtimeConfig: {
    apiKey: "", // Default to an empty string, automatically set at runtime using process.env.NUXT_API_KEY
    public: {
      baseURL: "http://localhost:3003", // Exposed to the frontend as well.
    }
  },
  plugins: ['~/plugins/antd-ui.ts'],
  vite: {
    envDir: '~/env', // 指定env文件夹
    server: {
      proxy: {
        '/serverApi': {
          target: 'http://localhost:3003/',
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/serverApi/, ''),
        },

      }
    }
  },

  compatibilityDate: '2024-12-19'
})